/**
 *   api
 *  @module code/api/reportReportDashboard
 *  @author coder
 */

import ajax from '@/utils/HttpUtil'
import { API_HOST } from '/env'

/**
 * 删除或批量删除
 * @const
 * @type {String}
 * @default  '[API_HOST]/report/reportdashboard/delete'
 */
export const POST_REPORTDASHBOARD_DELETE = API_HOST + '/report/reportdashboard/delete'

/**
 * 删除或批量删除
 * @param {object} [data] 发送键值对数据
 * @param {object} [options] ajax参数选项
 * @returns {Promise}
 */
export function postReportdashboardDelete(data, options) {
  return ajax({
    method: 'post',
    data: data,
    url: POST_REPORTDASHBOARD_DELETE,
    ...options
  })
}

/**
 * 详情-带viewcode
 * @const
 * @type {String}
 * @default  '[API_HOST]/report/reportdashboard/detail/:id'
 */
export const GET_REPORTDASHBOARD_DETAIL_ID = API_HOST + '/report/reportdashboard/detail/:id'

/**
 * 详情-带viewcode
 * @param {string|number} id Url参数id
 * @param {object} [data] 发送键值对数据
 * @param {object} [options] ajax参数选项
 * @returns {Promise}
 */
export function getReportdashboardDetailId(id, data, options) {
  return ajax({
    method: 'get',
    params: {
      id
    },
    data: data,
    url: GET_REPORTDASHBOARD_DETAIL_ID,
    ...options
  })
}

/**
 * 详情
 * @const
 * @type {String}
 * @default  '[API_HOST]/report/reportdashboard/info/:id'
 */
export const GET_REPORTDASHBOARD_INFO_ID = API_HOST + '/report/reportdashboard/info/:id'

/**
 * 详情
 * @param {string|number} id Url参数id
 * @param {object} [data] 发送键值对数据
 * @param {object} [options] ajax参数选项
 * @returns {Promise}
 */
export function getReportdashboardInfoId(id, data, options) {
  return ajax({
    method: 'get',
    params: {
      id
    },
    data: data,
    url: GET_REPORTDASHBOARD_INFO_ID,
    ...options
  })
}

/**
 * 分页查询
 * @const
 * @type {String}
 * @default  '[API_HOST]/report/reportdashboard/list'
 */
export const POST_REPORTDASHBOARD_LIST = API_HOST + '/report/reportdashboard/list'

/**
 * 分页查询
 * @param {object} [data] 发送键值对数据
 * @param {object} [options] ajax参数选项
 * @returns {Promise}
 */
export function postReportdashboardList(data, options) {
  return ajax({
    method: 'post',
    data: data,
    url: POST_REPORTDASHBOARD_LIST,
    ...options
  })
}

/**
 * 新增
 * @const
 * @type {String}
 * @default  '[API_HOST]/report/reportdashboard/save'
 */
export const POST_REPORTDASHBOARD_SAVE = API_HOST + '/report/reportdashboard/save'

/**
 * 新增
 * @param {object} [data] 发送键值对数据
 * @param {object} [options] ajax参数选项
 * @returns {Promise}
 */
export function postReportdashboardSave(data, options) {
  return ajax({
    method: 'post',
    data: data,
    url: POST_REPORTDASHBOARD_SAVE,
    ...options
  })
}

/**
 * 修改
 * @const
 * @type {String}
 * @default  '[API_HOST]/report/reportdashboard/update'
 */
export const POST_REPORTDASHBOARD_UPDATE = API_HOST + '/report/reportdashboard/update'

/**
 * 修改
 * @param {object} [data] 发送键值对数据
 * @param {object} [options] ajax参数选项
 * @returns {Promise}
 */
export function postReportdashboardUpdate(data, options) {
  return ajax({
    method: 'post',
    data: data,
    url: POST_REPORTDASHBOARD_UPDATE,
    ...options
  })
}
